glestfandomcom-20200213-history
GAE/Subfactions
Subfactions is a mechanism that allows a single faction to have multiple overlapping definitions that allow the rules of what commands, units, buildings, skills, upgrades, morphs, etc. are available to change. Subfactions generally progress from the "base" subfaction (i.e., no "sub" in the faction) on to more advanced subfactions. This progression may be linear, or it may branch allowing multiple paths of progression. Some examples of similar mechanism in other RTS games are the progression to different "ages" in Age of Empires or Empire Earth. Limitations *There is currently a hard limit of 32 subfactions per faction. *The AI cannot yet play subfactions at all. How they work When not defined, each faction has only the "base" subfaction (which is to say none). To use subfactions, you must first add them to the faction XML. For example, to give a faction two subfactions, you could use the following code. This will cause thefaction to posses the subfactions "base" (the default), "subfaction1" and "subfaction2". Subfaction restrictions Subfaction restrictions can be applied to any command, unit (including buildings) or upgrade by specifying a list of subfactions that the item is allowed in with a tag. If tag is not present, then all subfactions are allowed (eg, no restrictions). For units, the tag is added to the node; for commands, they go directly under the node; and for upgrades, they go directly under the node. Advancing into a subfaction Anything that is produced, such as producing a unit, constructing a building, or performing an upgrade, can be used to advance into a subfaction. This is done with the tag. This is either found in the parameters if a unit, or in the upgrade element if an upgrade, and looks like this: The name is the name of the subfaction to advance into. Is-immediate determines if the faction should be advancing into the subfaction when the upgrade/production is complete ("false") or when it starts ("true"). Example In Four Path Magitech, players are allowed to choose an advanced subfaction once a basic infrastructure is built. When the game starts, the the Mage Tower can produce initiates, but there are also two upgrades, "Path of Corruption" and Path of Nature" which are greyed out until the summoner's guild and library are built, where upon they both become available. Once either of these upgrades complete, the subfaction advances and the option to upgrade the other disappears. In fact, all producible commands will disappear if they are not available in the new subfaction. The first thing you may notice is that this upgrade is only available in the "base" subfaction. It exists solely for the purpose of allowing path of corruption units to be built, this is done with the the is-immediate attribute is set to true, the advancement will occur as soon as the building, upgrading, morphing or producing begins. Otherwise, the advancement will occur once it is completed. In FPM, some of the original units were around to better fit the story line. The creators didn't feel it would be normal for magicians who later embraced nature, life and all things good to be summoning giant daemons and researching hell gates, we moved these to the path of corruption. This means that when you first build your library, you will not see the ability to research Hell Gate at all until (and unless) you research the path_of_corruption upgrade (which causes the advancement). This behavior is again caused by adding the tag. See also *List of GAE features Category:GAE Category:Detailed feature pages